<template>
  <div class="talk">
    <div class="header">
      <div class="left">
        <div class="img">
          <img
            src="https://www.suoyiren.com/uc_server/images/noavatar_middle.gif?ts=1640112318"
            alt=""
          />
        </div>
      </div>
      <div class="mid">
        <h2>社区</h2>
      </div>
      <div class="right">
        <router-link tag="div" to="/search" class="img">
          <img src="../assets/img/fdj.png" alt="" />
        </router-link>
      </div>
    </div>

    <div class="nav">
      <ul>
        <li>
          <span>商城</span>
        </li>
        <li>
          <span>版区</span>
        </li>
        <li>
          <span class="con">新帖</span>
        </li>
        <li>
          <span>热门</span>
        </li>
        <li>
          <span>精选</span>
        </li>
      </ul>
    </div>

    <div class="day">
      <div class="item">
        <div class="date">
          <p>今日</p>
        </div>
        <div class="num">
          <span>384</span>
        </div>
      </div>
      <div class="item">
        <div class="date">
          <p>昨日</p>
        </div>
        <div class="num">
          <span>365</span>
        </div>
      </div>
      <div class="item">
        <div class="date">
          <p>帖子</p>
        </div>
        <div class="num">
          <span>2188872</span>
        </div>
      </div>
      <div class="item">
        <div class="date">
          <p>会员</p>
        </div>
        <div class="num">
          <span>861126</span>
        </div>
      </div>
    </div>

    <div class="notice">
      <div class="zi">公告</div>
      <div class="right">
        <van-swipe
          style="height: 20px"
          vertical
          :show-indicators="false"
          :autoplay="3000"
        >
          <van-swipe-item>锁艺人网站官方工作人员联系方式</van-swipe-item>
          <van-swipe-item>锁艺人论坛新注册师傅帮助教程</van-swipe-item>
          <van-swipe-item>锁匠师傅常用设备工具操作视频</van-swipe-item>
        </van-swipe>
      </div>
    </div>

    <div class="boxx">
      <div class="box">
        <div class="title">
          <p>综合版块</p>
        </div>
        <div class="boz">
          <div class="ball"></div>
        </div>
      </div>
    </div>

    <div class="reception">
      <div class="item" v-for="(item, index) in comprehensive" :key="index">
        <div class="img">
          <img :src="item.img" alt="" />
        </div>
        <div class="word">
          <p>{{ item.title }}</p>
        </div>
      </div>
    </div>

    <div class="boxx">
      <div class="box">
        <div class="title">
          <p>厂商版块</p>
        </div>
        <div class="boz">
          <div class="ball"></div>
        </div>
      </div>
    </div>

    <div class="main">
      <div class="items" v-for="(item, index) in manufacturer" :key="index">
        <div class="img">
          <img :src="item.img" alt="" />
        </div>
        <div class="content">
          <p>{{ item.title }}</p>
          <span>{{ item.word }}</span>
        </div>
      </div>
    </div>

    <div class="duo"></div>

    <div class="footer">
      <ul>
        <router-link tag="li" to="/home">
          <a>
            <div class="img">
              <img src="../assets/img/shouye.png" alt="" />
            </div>
            <div class="word">
              <p>首页</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/talk">
          <a>
            <div class="img">
              <img src="../assets/img/taolun1.png" alt="" />
            </div>
            <div class="word">
              <p class="con">交流</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/release">
          <a>
            <div class="img">
              <img src="../assets/img/fabulow.png" alt="" />
            </div>
            <div class="word">
              <p>发布</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/find">
          <a>
            <div class="img">
              <img src="../assets/img/quan.png" alt="" />
            </div>
            <div class="word">
              <p>发现</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/my">
          <a>
            <div class="img">
              <img src="../assets/img/wo.png" alt="" />
            </div>
            <div class="word">
              <p>我的</p>
            </div>
          </a>
        </router-link>
      </ul>
    </div>
  </div>
</template>

<script>
import { getcomprehensive, getmanufacturer } from "../api/talk";
export default {
  data() {
    return {
      comprehensive: null,
      manufacturer: null,
    };
  },
  created() {
    getcomprehensive().then((data) => {
      this.comprehensive = data.comprehensive;
      // console.log(this.comprehensive);
    });
    getmanufacturer().then((data) => {
      this.manufacturer = data.manufacturer;
    });
  },
};
</script>

<style lang="scss" scoped>
.talk {
  .header {
    height: 48px;
    background: #53bcf5;
    display: flex;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    .mid {
      flex: 1;
      color: #fff;
      font-size: 15px;
      line-height: 48px;
      h2 {
        text-align: center;
        font-weight: normal;
      }
      img {
        margin: 0 12px;
        width: 20px;
        height: 20px;
        vertical-align: sub;
      }
    }
    .left {
      .img {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        overflow: hidden;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
    .right {
      .img {
        width: 25px;
        height: 25px;
        img {
          width: 100%;
        }
      }
    }
  }
  .header .left,
  .header .right {
    width: 15.4%;
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
  }

  .nav {
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #efefef;
    margin-top: 48px;
    ul {
      display: flex;
      text-align: center;
      li {
        flex: 1;
        span {
          font-size: 16px;
          &.con {
            color: #53bcf5;
            border-bottom: 3px solid #53bcf5;
          }
        }
      }
    }
  }
  .day {
    display: flex;
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px solid #efefef;
    .item {
      flex: 1;
      border-right: 1px solid #efefef;
      .date {
        p {
          color: #9fa19f;
          font-size: 12px;
        }
      }
      .num {
        span {
          font-size: 20px;
        }
      }
    }
  }
  .notice {
    display: flex;
    padding: 10px 0;
    border-bottom: 10px solid #f3f3f3;
    .zi {
      margin-left: 15px;
      background: #ff9900;
      color: #fff;
      font-size: 14px;
    }
    .right {
      flex: 1;
      margin-left: 15px;
      font-size: 14px;
      color: #4245ff;
    }
  }
  .box {
    display: flex;
    margin: 0 15px;
    padding: 10px 0;
    .title {
      flex: 1;
    }
    .boz {
      height: 15px;
      width: 30px;
      border: 1px solid #efefef;
      border-radius: 8px;
      display: flex;
      justify-content: flex-end;
      .ball {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #53bcf5;
        margin-top: 2px;
      }
    }
  }
  .boxx {
    border-bottom: 1px solid #dcdfe7;
  }
  .reception {
    display: flex;
    text-align: center;
    border-bottom: 10px solid #f3f3f3;
    .item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      border-right: 1px solid #dcdfe7;
      padding-bottom: 8px;
      &:last-child {
        border: none;
      }
      .img {
        width: 48px;
        height: 48px;
        img {
          width: 100%;
        }
      }
    }
  }
  .main {
    display: flex;
    flex-direction: column;
    .items {
      flex: 1;
      display: flex;
      border-bottom: 1px solid #dcdfe7;
      padding: 10px;
      .img {
        width: 46px;
        height: 46px;
        img {
          width: 100%;
        }
      }
      .content {
        margin-left: 16px;
        p {
          font-size: 16px;
        }
        span {
          font-size: 12px;
          color: #dcdfe7;
        }
      }
    }
  }
  .duo {
    height: 60px;
  }
  .footer {
    background: #fff;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    ul {
      display: flex;
      li {
        flex: 1;
        a {
          display: flex;
          flex-direction: column;
          align-items: center;
          .img {
            width: 24px;
            height: 24px;
            img {
              width: 100%;
            }
          }
          .word {
            p {
              color: #999;
              font-size: 12px;
              &.con {
                color: #45dfe7;
              }
            }
          }
        }
      }
    }
  }
}
</style>
